﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dcms.Config;
using Dcms.Common;
using Dcms.BaseClass;

public partial class System_Validate : System.Web.UI.Page
{
    WebSiteConfigInfo etWebSiteConfigInfo = WebSiteConfigs.Deserialize("~/SystemConfig/WebSiteInfo.config");
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (DcmsAuth.Validate(etWebSiteConfigInfo.snCode))
            {
                string urlRef = DcmsRequest.GetUrlReferrer();
                Response.Redirect(urlRef);
            }
        }
    }
    protected void btnValidate_Click(object sender, EventArgs e)
    {
        etWebSiteConfigInfo.snCode = txtsnCode.Text.Trim();
        WebSiteConfigs.Serialiaze(etWebSiteConfigInfo, "~/SystemConfig/WebSiteInfo.config");
        if (DcmsAuth.Validate(txtsnCode.Text.Trim()))
        {
            Jscript.AlertAndRedirect("验证成功,感谢你的注册", DcmsRequest.GetUrlReferrer());
        }
        else
        {
            Jscript.AlertAndBack("验证失败,请重新验证");
        }
    }
}
